Skip to content

Add Watchdog trait#13

Merged
williampMSFT merged 4 commits intoOpenDevicePartnership:mainfrom
williampMSFT:user/williamp/watchdog
Mar 17, 2026
Merged

Add Watchdog trait#13
williampMSFT merged 4 commits intoOpenDevicePartnership:mainfrom
williampMSFT:user/williamp/watchdog

Conversation

@williampMSFT
Copy link
Contributor

This adds a trait to feed a watchdog timer

@williampMSFT williampMSFT marked this pull request as ready for review March 9, 2026 23:42
@williampMSFT williampMSFT requested a review from a team as a code owner March 9, 2026 23:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new Watchdog trait to the embedded-mcu-hal crate, providing an abstraction for feeding a processor's watchdog timer to prevent resets. It includes a blanket implementation for &mut T references.

Changes:

  • Added a new Watchdog trait with an associated Error type and a feed method
  • Added a blanket impl of Watchdog for &mut T where T: Watchdog
  • Registered the new watchdog module as a public module in lib.rs

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
embedded-mcu-hal/src/watchdog.rs New file defining the Watchdog trait with a feed method and a blanket impl for &mut T
embedded-mcu-hal/src/lib.rs Adds pub mod watchdog; to expose the new module

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

kurtjd
kurtjd previously approved these changes Mar 10, 2026
jerrysxie
jerrysxie previously approved these changes Mar 11, 2026
@williampMSFT williampMSFT dismissed stale reviews from jerrysxie and kurtjd via e4205d9 March 16, 2026 18:33
@williampMSFT williampMSFT enabled auto-merge (squash) March 16, 2026 18:33
kurtjd
kurtjd previously approved these changes Mar 16, 2026
Copy link
Contributor

@jerrysxie jerrysxie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@felipebalbi @williampMSFT Are we aligned on implementing this for MCXA and IMXRT?

@williampMSFT
Copy link
Contributor Author

@felipebalbi @williampMSFT Are we aligned on implementing this for MCXA and IMXRT?

I think so, yeah. There are a couple catches, though - we need to publish this crate to crates.io with semver versions, and we need to hide the implementation and linkage to embedded-mcu on the MCXA HAL behind a feature flag

@jerrysxie jerrysxie requested review from JamesHuard and gjpmsft March 16, 2026 20:19
@jerrysxie jerrysxie disabled auto-merge March 16, 2026 20:19
@jerrysxie jerrysxie requested a review from bramsdell-ms March 16, 2026 20:21
@jerrysxie
Copy link
Contributor

jerrysxie commented Mar 16, 2026

@gjpmsft @JamesHuard @bramsdell-ms @jamesmunns @diondokter Any feedback on this initial implementation of a MCU agnostic watchdog trait?

@jerrysxie jerrysxie added the enhancement New feature or request label Mar 16, 2026
RobertZ2011
RobertZ2011 previously approved these changes Mar 16, 2026
This reverts commit 8dcd438.
@williampMSFT williampMSFT dismissed stale reviews from RobertZ2011 and kurtjd via 43259ac March 17, 2026 16:09
@williampMSFT williampMSFT enabled auto-merge (squash) March 17, 2026 16:51
@williampMSFT williampMSFT merged commit 9cf60db into OpenDevicePartnership:main Mar 17, 2026
10 checks passed
@williampMSFT williampMSFT deleted the user/williamp/watchdog branch March 17, 2026 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

7 participants